package func.equ;

public class MafEquation implements Equation<Double> {
	
	/**
	 * Ordering of parameters:
	 * K1, K2, K3, k1, k2, k3, c3
	 */
	@Override
	public Double getResult(Double[] value) {
		double K1 = value[0];
		double K2 = value[1];
		double K3 = value[2];
		double k1 = value[3];
		double k2 = value[4];
		double k3 = value[5];
		double C3 = value[6];
		double a1 = k3/k2*Math.sin(K3-C3);
		double a2 = k1/k2*Math.sin(K1-Math.asin(k3/k1*Math.sin(C3)));
		double res = K2 - Math.asin(a1) - Math.asin(a2);
		return res;
	}
}
